<template>
  <div class="person">
    <ul>
      <li v-for="item in list" :key="item.id">
        {{ item.name }} -- {{ item.age }}
      </li>
    </ul>
  </div>
</template>
<script setup lang="ts" name="Person234">
  import type { Persons } from '@/types';
  import {defineProps,withDefaults} from 'vue';
  //只接受list
  // defineProps(['list'])

  //接受+限制
  // defineProps<{list:Persons}>()

  //接受+限制+必要性+制定默认值
  withDefaults(defineProps<{list?:Persons}>(),{
    list:()=>[{id:'adfafaf002',name:'lisi',age:20}]
  })
</script>
<style>

</style>